<?php
class Warna_model extends CI_Model{

	function   __construct() {
        parent::__construct();
    }

    function getWarna(){

	   $query = $this->db->query("SELECT *  FROM Warna
               ORDER BY intid_warna ASC");
	   return $query->result();
    }

	function insert($data){
	$data = array(
            'strwarna' => $this->input->post('strwarna'));
        $this->db->insert('warna', $data);
	}

   function delete($idwarna){
       $this->db->where('intid_warna', $idwarna);
       $this->db->delete('warna');
    }

    function select($idwarna){
       $query = $this->db->query("select * from Warna where intid_warna= $idwarna");
	   return $query->result();
    }

	function update($idwarna){
            $data = array(
            'strwarna' => $this->input->post('strwarna'));
            $this->db->where('intid_warna', $idwarna);
            $this->db->update('warna',$data);
    }
}
?>
